<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>佐心，教家长做父母</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
	<c:set var="ctx" value="${pageContext.request.contextPath}" />
    <link rel="stylesheet" href="assets/css/amazeui.min.css">
    <link rel="stylesheet" href="assets/css/style.css?v=2.3">
    <link rel="stylesheet" href="assets/css/index.css?v=2.3">
    <script>
    var counseTel='${param.tel}';
     var linkJpg="http://m.zuoxinjiazhang.com/js/zuoxin.jpg";
	var title="咨询师详情页";
	var content="佐心，教家长做智慧父母。"+title+"";
    </script>
    <script>
    	    /** 
     * 返回前一页（或关闭本页面） 
     * <li>如果没有前一页历史，则直接关闭当前页面</li> 
     */  
    function goBack(){  
        if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // IE  
            if(history.length > 0){  
                window.history.go( -1 );  
            }else{  
                location.href="${ctx}/index.jsp";
            }  
        }else{ //非IE浏览器  
            if (navigator.userAgent.indexOf('Firefox') >= 0 ||  
                navigator.userAgent.indexOf('Opera') >= 0 ||  
                navigator.userAgent.indexOf('Safari') >= 0 ||  
                navigator.userAgent.indexOf('Chrome') >= 0 ||  
                navigator.userAgent.indexOf('WebKit') >= 0){  
      
                if(window.history.length > 1){  
                    window.history.go( -1 );  
                }else{  
                    location.href="${ctx}/index.jsp";
                }  
            }else{ //未知的浏览器  
                window.history.go( -1 );  
            }  
        }  
    }  
    </script>
</head>
<body class="bg-white">
<header data-am-widget="header" class="am-header am-header-default am-header-fixed am-border-bottom bg-4">
    <div class="am-header-left am-header-nav">
        <a  onclick="goBack();"  >
            <i class="icon_8"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        咨询师详情
    </h1>
    <!--<div class="am-header-right am-header-nav am-text-right">-->
    <!--<a href="#">-->
    <!--评价-->
    <!--</a>-->
    <!--</div>-->
</header>
<section class="am-padding-bottom-sm" id="amz-main" data-tag="css-nav">

    <div class="my-top am-padding-top-sm font-color-white">
        <div class="am-text-center"><img id="personHead" src="assets/images/upload/icon_73.png" class="am-circle"></div>
        <div class="am-margin-top-xs am-text-center zhanwei" id="cName"></div>
        <div class=" am-text-center am-text-sm margin-top-5" id="proName"></div>
    </div>

    <div data-am-widget="tabs" class="am-tabs am-tabs-d2 bg-white" data-am-tabs-noswipe="1">
        <ul class="am-tabs-nav am-cf ">
            <li class="am-active">
                <a href="[data-tab-panel-0]">简介</a>
            </li>
            <c:if test="${freeAskList!='[]'}">     
            <li class="">
                <a href="[data-tab-panel-1]">咨询</a>
            </li>
            </c:if>
            <li class="">
                <a href="[data-tab-panel-2]">培训</a>
            </li>
        </ul>
        <div class="am-tabs-bd">
            <!--简介-->
            <div data-tab-panel-0 class="am-tab-panel am-active ">

                <!--擅长方向-->
                <div class="am-container am-margin-top-xs">
                    <div class="box font-color-13 am-padding-top-sm am-padding-bottom-sm border-bottom">
                        <div class="width-30px">
                            <i class="icon_70_1"></i>
                        </div>
                        <div class="box-1" id="direction"></div>
                    </div>
                </div>


                <!--专业背景-->
                <div class="am-container am-margin-top-xs">
                    <div class="border-bottom profs213" >
                        
                    </div>
                </div>


                <!--服务价格-->
                <div class="am-container am-margin-top-xs">
                    <div class="">
                        <div class="box font-color-13 am-padding-top-sm am-padding-bottom-sm ">
                            <div class="width-30px prelative">
                                <i class="icon_69_1"></i>
                            </div>
                            <div class="box-1">服务价格</div>
                        </div>
                        <div class="box font-color-13 font-14  am-padding-bottom-sm ">
                            <div class="box-1 dian prelative padding-left-30" id="service15Price"></div>
                        </div>
                        <div class="box font-color-13 font-14  am-padding-bottom-sm ">
                            <div class="box-1 dian prelative padding-left-30" id="service40Price"></div>
                        </div>
                        <div class="box font-color-13 font-14  am-padding-bottom-sm ">
                            <div class="box-1 dian prelative padding-left-30" id="counseTypes"></div>
                        </div>
                    </div>
                </div>


                <!--用户评价-->
                <div class="icon_24 am-text-center font-color-13">
                    <c:if test="${orderList!='[]'}">用户评价 </c:if>
                </div>
                <div class="mark_list">
					<c:if test="${orderList=='[]'}">
					 <!-- <div class="icon_55"></div>-->
					 <!-- <div class="am-text-center font-14 font-color-15">暂无评论，快点击评论按钮，抢沙发吧！</div>-->
					 </c:if>
                     <div class="am-list-news am-list-news-default ">
                        <div class="am-list-news-bd am-margin-left-sm am-margin-right-sm">
                            <ul class="am-list">
                                <c:forEach items="${orderList}" var="pj" varStatus="i">
                                <c:if test="${i.index<300}">
                                <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
                                    <div class=" am-u-sm-12 am-list-main font-14 box">
                                        <div class="width-60px">
                                            <a class="">
                                                <img class="img-50" src=" ${pj.headimgurl}"/>
                                            </a>
                                        </div>
                                        <div class="box-1 margin-top-5">
                                            <h3 class="am-list-item-hd font-color-main">
                                                <div class="am-g am-g-collapse">
                                                    <div class="am-u-sm-8"><span
                                                            class="font-color-13 font-15 font-bold"> ${pj.nickname}</span>
                                                    </div>
                                                    <div class="am-u-sm-4 font-color-16  padding-top-2pxs am-text-right">
                                                        ${pj.pingjiaTimeStr}
                                                    </div>
                                                </div>
                                            </h3>
                                            <div class="font-14 font-color-13 ">
                                                <span class="am-fl font-color-15">评分：</span>
                                                <c:if test="${pj.pingjiaxx==1}">
                                         	<i class="star-cur"></i>
                                         	  <i class="star"></i>
                                         	    <i class="star"></i>
                                         	      <i class="star"></i>
                                         	        <i class="star"></i>
                                        </c:if>
                                        <c:if test="${pj.pingjiaxx==2}">
                                         	<i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                         	   <i class="star"></i>
                                         	     <i class="star"></i>
                                         	       <i class="star"></i>
                                        </c:if>
                                        <c:if test="${pj.pingjiaxx==3}">
                                         	<i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                         	   <i class="star"></i>
                                         	     <i class="star"></i>
                                        </c:if>
                                        <c:if test="${pj.pingjiaxx==4}">
                                         	<i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
                                         	 <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
	                                        <i class="star"></i>
                                        </c:if>
                                        <c:if test="${pj.pingjiaxx==5}">
                                         	<i class="star-cur"></i>
	                                        <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
	                                        <i class="star-cur"></i>
                                        </c:if>
                                            </div>
                                        </div>
                                    </div>
                                    <div class=" am-u-sm-12 am-list-main font-14 font-color-15 am-margin-top-xs">
                                        ${pj.pingjia}
                                    </div>
                                </li>
                                </c:if>
                                </c:forEach>
                            </ul>
                        </div>
                    </div>
                    <div class="font-color-12 am-text-center am-container">
                        <div class="border-tops width-100 am-margin-top-sm am-padding-top-sm am-padding-bottom-sm" onclick="window.location.href='14.html'">
          <c:if test="${orderList!='[]'}">                 
                           <!--  全部评论 -->
          </c:if>
                        </div>
                    </div>

                    <!--<div class="icon_55"></div>-->
                    <!--<div class="am-text-center font-14 font-color-15">暂无评论，快点击评论按钮，抢沙发吧！</div>-->
                </div>
            </div>
            <!--咨询-->
            <div data-tab-panel-1 class="am-tab-panel bg-gray ">
				<c:if test="${freeAskList=='[]'}">                 
                           <div class='am-text-center font-12 font-color-16 am-padding-top-lg am-padding-bottom-lg'>该专家暂无培训计划，敬请期待!</div>
          		</c:if>
                <!--列表-->
                <c:if test="${freeAskList!='[]'}">   
                 <div class="am-padding-top-sm am-padding-bottom-sm bg-white  am-margin-bottom-sm am-margin-top-sm">
                <div class="icon_26 am-text-center font-color-12 ">
                    咨询示例
                </div>
                </div>
                </c:if>
                <div class="consult_list">
                	<c:forEach items="${freeAskList}" var="free">
                    <div class="consult_item am-margin-bottom-sm">
                        <div class="am-g am-padding-top-sm bg-white">
                            <div class=" am-u-sm-12 am-list-main font-color-13 box">
                                <div class="width-50px">
                                    <div class="icon_71_1"></div>

                                </div>
                                <div class="box-1 prelative">
                                    <div class="am-list-item-hd font-color-13 padding-top-10">
                                        问题:<span style="margin-left:10%">${free.direction}</span>
                                    </div>
                                </div>
                                <div class="font-12 width-120pxs am-text-right font-color-16 padding-top-15">${free.askTimeStr}
                                </div>
                            </div>
                            <div class="am-u-sm-12 font-14 am-margin-top-sm">
                                <c:if test="${free.type==0}">
            						${free.question}
				            	</c:if>
				            	<c:if test="${free.type==1}">
				            		<div class='btn_18 voice' >
						 			<input type='hidden' value="${free.question}">
						            <i class='icon_711 '></i><span></span>
						            </div>
				            	</c:if>
                            </div>
                        </div>
                        <div class="bg-white am-padding-bottom-sm am-padding-top-sm">
                            <div class=" bg-gray am-margin-left-sm am-margin-right-sm ">
                                <div class="am-g   am-padding-top-sm border-1">

                                    <div class=" am-u-sm-12 am-list-main">
                                        <i class="icon_12"></i>

                                        <div class="font-14  font-color-main am-padding-left-sm">
                                            回复： <c:if test="${free.isYuyin==0}">
            			${free.counseAnswer}
            	</c:if>
            	<c:if test="${free.isYuyin==1}">
            		<div class='btn_18 voice' >
		 			<input type='hidden' value="${free.counseAnswer}">
		            <i class='icon_711 '></i><span></span>
		            </div>
            	</c:if>
                                        </div>
                                    </div>
                                    <div class="am-u-sm-7 am-margin-top-xs">
                                        <div class="border-tops font-color-13 font-14 am-padding-left-sm  am-padding-top-sm am-padding-bottom-sm prelative">
                                            ${free.pingjiaTimeStr}
                                        </div>
                                    </div>
                                    <div class="am-u-sm-5 am-margin-top-xs">
                                        <div class="border-tops font-color-12 font-14 am-text-right am-padding-top-sm am-padding-bottom-sm prelative">
                                            <i class="icon_52"></i><span class="yuyue">去预约</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    </c:forEach>

                </div>


            </div>
            <!--培训-->
            <div data-tab-panel-2 class="am-tab-panel bg-gray">
                <!--列表-->
                <div class=" traincamp_list  ">
                   

                </div>
            </div>
        </div>
    </div>
<!--隐藏音频-->
    <div class="am-hide">
        <audio src=""  id="audio">亲 您的浏览器不支持html5的audio标签</audio>
    </div>

</section>
<footer data-am-widget="navbar" class="am-navbar am-cf am-navbar-default bg-white"
        id="">
    <div class="am-g   am-g-collapse am-padding-left-sm">
        <div class="am-u-sm-4 font-color-1 am-padding-right-sm" id="shouchang">
            <div class="btn-4"><span class="prelative"><i class="icon_48"></i>收藏</span></div>
        </div>
        <div class="am-u-sm-4 am-padding-right-sm">
            <div class="btn-4" onclick="showPop()"><span class="prelative"><i class="icon_49"></i>分享</span></div>
        </div>
        <div class="am-u-sm-4 am-padding-right-sm" id="btnmark">
            <div class="btn-4 yuyue"><span class="prelative"><i class="icon_71s"></i>预约</span></div>
        </div>
    </div>

</footer>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/common.js"></script>
<script>
function goPeiDesc(id){
   location.href="gotoPeixunDesc?studyId="+id;
}
	$(function () {
	
	 	var aaaStr=$.ajax({url:"isShouchang2?tel="+counseTel,async:false});
        var shouJson=JSON.parse(aaaStr.responseText);
        if(shouJson.resultCode==1){
        	$("#shouchang").find("i.icon_48").addClass("cur");
        }
		
	
	 	var counselorList=$.ajax({url:"myData?counseTel="+counseTel,async:false});
        var jsonCounselor=JSON.parse(counselorList.responseText);
        
        if(jsonCounselor.resultCode=="0"){
        	$("#cName").text(jsonCounselor.counselor.counseName);
        	title="咨询师-"+jsonCounselor.counselor.counseName+"的"+title;
        	$("#rGrade").text(jsonCounselor.counselor.recommenGrade);
        	$("#proName").text(jsonCounselor.counselor.proName);
        	$("#direction").text("擅长方向："+jsonCounselor.counselor.goodDirection);
        	
        	var couns="";
        	if(null!=jsonCounselor.counselor.counseType){
        		var counseTypes=jsonCounselor.counselor.counseType.split(",");
        		for(var i=0;i<counseTypes.length;i++){
        			if(counseTypes[i]=="1"){
        				couns+="电话咨询 ,";
        			}
        			if(counseTypes[i]=="2"){
        				couns+="面对面咨询 ,";
        			}
        			if(counseTypes[i]=="3"){
        				couns+="视频咨询 ,";
        			}
        			if(counseTypes[i]=="4"){
        				couns+="免费提问 ,";
        			}
        		}
        	}
        	$("#counseTypes").text(""+couns.substr(0,couns.length-1));
        	if(null!=jsonCounselor.counselor.servicePrice15){
        	$("#service15Price").text("￥"+jsonCounselor.counselor.servicePrice15+"元/15分钟");
        	}
        	if(null!=jsonCounselor.counselor.servicePrice40){
        	$("#service40Price").text("￥"+jsonCounselor.counselor.servicePrice40+"元/50分钟");
        	}
        	$("#personHead").attr("src",jsonCounselor.counselor.personHead);
        	
        	var professionalHtml="";
        	professionalHtml+="<div class='box font-color-13 am-padding-top-sm am-padding-bottom-sm '>";
            professionalHtml+="<div class='box-1'>专业背景</div></div>";
            
            var professionals=jsonCounselor.counselor.professional.split(",");
            for(var i=0;i<professionals.length;i++){
	            professionalHtml+="<div class='box font-color-13 font-14  am-padding-bottom-sm '>";
	            professionalHtml+="<div class='box-1 prelative'>"+professionals[i]+"</div></div>";
            }
            $(".profs213").html(professionalHtml);
            
            
            
        var counselorList=$.ajax({url:"getStudyList?studyType=2&counseTel="+counseTel,async:false});
        var jsonCounselor=JSON.parse(counselorList.responseText);
        
        var html="";
        if(jsonCounselor.resultCode=="0"){
        	for(var i=0;i<jsonCounselor.studylist.length;i++){
        		//html+="<a href='https:www.baidu.com'>";
				html+="<div class='traincamp_item bg-white am-padding-sm border-1 am-margin-bottom-sm'>";
			    html+="       <div class='box' onclick=goPeiDesc("+jsonCounselor.studylist[i].id+")>";
			    html+="            <div><img class='img-70-70' src='"+jsonCounselor.studylist[i].studyUrl+"'></div>";
			    html+="            <div class='box-1 am-padding-left-sm'>";
			    html+="                <div class='font-color-13 font-bold font-16 word-space-2' onclick='goPeiDesc("+jsonCounselor.studylist[i].id+")'>"+jsonCounselor.studylist[i].studyTitle+"</div>";
			    html+="                <div class=''>";
			    html+="                    <ul class='am-pagination am-pagination-default' >";
			    if(null!=jsonCounselor.studylist[i].studyLabel && ""!=jsonCounselor.studylist[i].studyLabel){
			    	var studyLabel=jsonCounselor.studylist[i].studyLabel;
			    	var label=studyLabel.split(",");
			    	for(var j=0;j<label.length;j++){
			    		html+="  <li class='am-active'>";
			   			html+="      <a href='#' class=''>"+label[j]+"</a>";
			    		html+="  </li>";
			    	}
			    }
			    html+="                    </ul>";
			    html+="                </div>";
			    html+="                <div class='font-color-16'>培训方向："+jsonCounselor.studylist[i].studyDirection+"</div>";
			    html+="            </div>";
			    html+="        </div>";
			    html+="        <div class='am-g bg-gray am-margin-top-sm  am-padding-bottom-sm  prelative'>";
			    html+="            <i class='icon_12s'></i>";
			    html+="            <div class='am-u-sm-12  font-15 '>";
			    html+="                <div class=' font-color-13  am-padding-top-sm  box'>";
			    html+="                    <div class='width-50px'><i class='icon_28'></i></div>";
			    html+="                    <div class='box-1'><span>人数上限：</span><span>"+jsonCounselor.studylist[i].maxStudent+"</span><span class='font-color-16'>(已报"+jsonCounselor.studylist[i].signStudent+")</span>";
			    html+="                    </div>";
			    html+="                </div>";
			    html+="            </div>";
			    html+="            <div class='am-u-sm-12  font-15'>";
			    html+="                <div class=' font-color-13  am-padding-top-sm  box'>";
			    html+="                    <div class='width-50px'><i class='icon_29'></i></div>";
			    html+="                    <div class='box-1'><span>培训时间："+jsonCounselor.studylist[i].startStudyStr+" -- "+jsonCounselor.studylist[i].endStudyStr+"</span></div>";
			    html+="                </div>";
			    html+="            </div>";
			    html+="        </div>";
			    html+="        <div class='am-g '>";
			    html+="            <div class='am-u-sm-6 padding-left-0'>";
			    html+="                <div class='btn-15 am-margin-top-sm'>";
			    html+="                    <span class='prelative am-margin-left-sm'> <i class='icon_25_1'></i>售价：&yen;"+jsonCounselor.studylist[i].studyPrice+"</span></div>";
			    html+="            </div>";
			    html+="            <div class='am-u-sm-6 padding-right-0'>";
				var peixunid=jsonCounselor.studylist[i].id;
			    hrefto="gotoConfirm?id="+peixunid;
			    if(jsonCounselor.studylist[i].maxStudent==jsonCounselor.studylist[i].signStudent){
			    html+="                <div class='btn-5 am-margin-top-sm'>已报滿</div>";			    
			    }else{
			    html+="                <a href="+hrefto+" style='color:white'><div class='btn-5 am-margin-top-sm'>立即购买</div></a>";			    
			    }
			    html+="            </div>";
			    html+="        </div>";
			    html+="    </div>";
			   // html+="    </a>";
		    }
		 }
			if(html==""){
				$(".traincamp_list").html("<div class='am-text-center font-12 font-color-16 am-padding-top-lg am-padding-bottom-lg'>该专家暂无培训计划，敬请期待!</div>");
			}else{
				$(".traincamp_list").html(html);
			}
        }
        
	});
	
    $("#shouchang").on('click', function () {
        var baseResponse2=$.ajax({url:"goShouchang2?tel="+counseTel,async:false});
	  	var isShouchang=JSON.parse(baseResponse2.responseText);
		if(isShouchang.resultCode=="0"){
		   	if($(this).find("i.icon_48").hasClass("cur")){
               	$(this).find("i.icon_48").removeClass("cur");
            }else{
            	$(this).find("i.icon_48").addClass("cur");
            }
	   	}
    });

    $(".report_item .voice").add(".consult_item .voice").on("click", function () {
        var audio = document.getElementById("audio");
            audio.src=$(this).find("input").val(); 
            
             var eventTester = function(e){
                audio.addEventListener(e,function(){
                    $voices.removeClass("cur");
                },false);
            };
            eventTester("ended");
            
          var $voices= $(this).find(".icon_711");
            $(".report_item .voice").find(".icon_711").remove("cur");
            if($voices.hasClass("cur")){
                $voices.removeClass("cur");
                audio.pause();
            }else{
                $voices.addClass("cur");
                audio.play();
            }

    });
    $(".yuyue").on("click",function(){
    	location.href="gotoyuyuejsp?tel="+counseTel;
    });

</script>
<div style="display:none">
<h3 id="menu-basic" style="display:none">基础接口</h3>    
<span class="desc"  style="display:none">判断当前客户端是否支持指定JS接口</span>    
<button class="btn btn_primary" id="checkJsApi"  style="display:none">checkJsApi</button>    
<h3 id="menu-share"  style="display:none">分享接口</h3>    
<span class="desc" >获取“分享到朋友圈”按钮点击状态及自定义分享内容接口</span>    
<button class="btn btn_primary" id="onMenuShareTimeline2" >onMenuShareTimeline</button>    
<span class="desc"  style="display:none">获取“分享给朋友”按钮点击状态及自定义分享内容接口</span>    
<button class="btn btn_primary" id="onMenuShareAppMessage"  style="display:none">onMenuShareAppMessage</button>    
<span class="desc"  style="display:none">获取“分享到QQ”按钮点击状态及自定义分享内容接口</span>    
<button class="btn btn_primary" id="onMenuShareQQ"  style="display:none">onMenuShareQQ</button>    
<span class="desc"  style="display:none">获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口</span>    
<button class="btn btn_primary" id="onMenuShareWeibo"  style="display:none">onMenuShareWeibo</button>       
<h3 id="menu-voice">音频接口</h3>    
<span class="desc">开始录音接口</span>    
<button class="btn btn_primary" id="startRecord2">startRecord</button>    
<span class="desc">停止录音接口</span>    
<button class="btn btn_primary" id="stopRecord">stopRecord</button>    
<span class="desc">播放语音接口</span>    
<button class="btn btn_primary" id="playVoice">playVoice</button>    
<span class="desc">暂停播放接口</span>    
<button class="btn btn_primary" id="pauseVoice">pauseVoice</button>    
<span class="desc">停止播放接口</span>    
<button class="btn btn_primary" id="stopVoice">stopVoice</button>    
<span class="desc">上传语音接口</span>    
<button class="btn btn_primary" id="uploadVoice">uploadVoice</button>    
<span class="desc">下载语音接口</span>    
<button class="btn btn_primary" id="downloadVoice">downloadVoice</button>    
<h3 id="menu-smart">智能接口</h3>    
<span class="desc">识别音频并返回识别结果接口</span>    
<button class="btn btn_primary" id="translateVoice">translateVoice</button>    
</div>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>   
<script>    
var nonceStr;
var timestamp;
var signature;
var appId;
htmlobj=$.ajax({url:"getSign?url="+location.href.split('#')[0],async:false});
var json=JSON.parse(htmlobj.responseText);
signature=json.signature; 
nonceStr=json.nonceStr; 
timestamp=json.timestamp; 
appId=json.appId; 
wx.config({    
debug: false,    
appId: appId,    
timestamp: timestamp,    
nonceStr: nonceStr,    
signature: signature,    
jsApiList: [        
'checkJsApi',    
'onMenuShareTimeline',    
'onMenuShareAppMessage',    
'onMenuShareQQ',    
'onMenuShareWeibo',    
'hideMenuItems',    
'showMenuItems',    
'hideAllNonBaseMenuItem',    
'showAllNonBaseMenuItem',    
'translateVoice',    
'startRecord',    
'stopRecord',    
'onRecordEnd',    
'playVoice',    
'pauseVoice',    
'stopVoice',    
'uploadVoice',    
'downloadVoice',    
'chooseImage',    
'previewImage',    
'uploadImage',    
'downloadImage',    
'getNetworkType',    
'openLocation',    
'getLocation',    
'hideOptionMenu',    
'showOptionMenu',    
'closeWindow',    
'scanQRCode',    
'chooseWXPay',    
'openProductSpecificView',    
'addCard',    
'chooseCard',    
'openCard'
]    
});    
</script>  
<script type="text/javascript">
wx.ready(function () {
// 1 判断当前版本是否支持指定 JS 接口，支持批量判断
document.querySelector('#checkJsApi').onclick = function () {
  wx.checkJsApi({
    jsApiList: [
      'getNetworkType',
      'previewImage'
    ],
    success: function (res) {
    }
  });
};
// 2. 分享接口
// 2.1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
  wx.onMenuShareAppMessage({
	  title: title,
  desc: content,
	  link: window.location.href,
	  imgUrl: linkJpg,
    trigger: function (res) {
    },
    success: function (res) {
      alert('已分享');
    },
    cancel: function (res) {
      alert('已取消');
    },
    fail: function (res) {
    }
  });
// 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
  wx.onMenuShareTimeline({
	  title: title,
  desc: content,
	  link: window.location.href,
	  imgUrl: linkJpg,
    trigger: function (res) {
    },
    success: function (res) {
      alert('已分享');
    },
    cancel: function (res) {
      alert('已取消');
    },
    fail: function (res) {
    }
  });
// 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
  wx.onMenuShareQQ({
	  title: title,
  desc: content,
	  link: window.location.href,
	  imgUrl: linkJpg,
    trigger: function (res) {
    },
    complete: function (res) {
      alert(JSON.stringify(res));
    },
    success: function (res) {
      alert('已分享');
    },
    cancel: function (res) {
      alert('已取消');
    },
    fail: function (res) {
    }
  });
// 2.4 监听“分享到微博”按钮点击、自定义分享内容及分享结果接口
document.querySelector('#onMenuShareWeibo').onclick = function () {
  wx.onMenuShareWeibo({
	   title: title,
  desc: content,
	  link: '${ctx}/myzones.jsp',
	  imgUrl: linkJpg,
    trigger: function (res) {
      alert('用户点击分享到微博');
    },
    complete: function (res) {
      alert(JSON.stringify(res));
    },
    success: function (res) {
      alert('已分享');
    },
    cancel: function (res) {
      alert('已取消');
    },
    fail: function (res) {
      alert(JSON.stringify(res));
    }
  });
  alert('已注册获取“分享到微博”状态事件');
};
var shareData = {
  title: title,
  desc: content,
  link: window.location.href,
  imgUrl: linkJpg,
};
wx.onMenuShareAppMessage(shareData);
wx.onMenuShareTimeline(shareData);
});
wx.error(function (res) {
});

</script>
</body>
</html>